﻿using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Linq;
using System.Text;
using System.IO;

namespace Mole
{
    class Dependency
    {
        /// <summary>
        /// Search application settings for files listed in dependencies
        /// </summary>
        /// <param name="searchDirectory"></param>
        /// <returns></returns>
        public static Boolean Check(String searchDirectory)
        {
            Boolean value = true;

            try
            {

                foreach (string requiredFile in Mole.Properties.Settings.Default.Dependencies)
                {
                    string filepath = searchDirectory + "\\" + requiredFile;

                    if (!File.Exists(filepath))
                    {
                        value = false;
                    }
                }
            }
            catch 
            {
                throw;
            }

            return value;
        }
    }
}
